#ifndef MANAGEMENT_H
#define MANAGEMENT_H
#pragma execution_character_set("utf-8")
#include <QObject>
#include <local_server.h>
#include <process_exe.h>
#include <tcp_server.h>
#include <QSharedPointer>
#include <QObject>
#include <handle_manage.h>
#include <QThread>
#include <process_exe.h>
#include <log.h>
#include <setting.h>
class Management: public QObject
{
    Q_OBJECT
public:
    Management();
    ~Management();
    void mysql_set(QString SQL_ip, QString SQL_Sname,QString Sql_Username,QString SQL_Password);  //设置数据库信息
    void tcpServer_init(int threadCount,int Port);         //初始化tcp服务器
    void localServer_init(QString listenName);             //初始化local服务器
    void process_init();                                   //初始化进程类
    bool tcpServer_start();                                //开启tcp服务器
    bool localServer_start();                              //开启local服务器
    bool process_start();                                  //开启进程
    void Handle_Setcount(int threadcount);                 //设置计算线程数量
    void Handle_Start();                                   //开启计算线程
    void StartLog();                                       //启用日志
    void Log_init(QString logname);                        //初始化日志
    void Configur_init(QString Filename);                  //配置初始化
    void StartConfigur();                                  //开启配置
private:
    local_server *l_server=NULL;                           //localserver智能指针
    QThread      *l_server_thread=NULL;                    //localserver线程
    tcp_server   *t_server=NULL;                           //t_server智能指针
    QThread      *t_server_thread=NULL;                    //t_server线程
    QSharedPointer<handle_manage>handlemanage;             //处理类指针
    QSharedPointer<QThread>      handle_thread;            //处理类线程
    QSharedPointer<process_exe>  process;                  //进程类
    QSharedPointer<Log>          mylog;                    //本地日志
    QSharedPointer<Setting>      mysetting;                //配置管理类
    int tcpServer_port=-1;
    int tcpServer_ThreadCount=-1;
    QString localServer_name;
};

#endif // MANAGEMENT_H
